package chixing.day10.innerclass;


import chixing.day09.interfacelean.Cpu;

public class Outer {
    private static int  num = 11;

//    static {
//        System.out.println("外部类: num = " + num);
//    }

    //成员内部类
    class A{
        private static int a = 22;
        static {
            System.out.println("成员内部类:a = " + a);
        }

    }
    //static内部类
    static class B{
        private static int b = 33;
        static {
            System.out.println("static 内部类: b = " + b );
        }
    }

    //局部内部类
    public void fun1(){
        System.out.println("fun1");
        class C{
            public void func(){
                System.out.println("func");
            }
        }
    }

    //匿名内部类
    public void fun2(Cpu cpu){

    }

    /////
    private String msg = "Outer";

    class Inner {
        String msg = "Inner";

        void print() {
            System.out.println(Outer.this.msg);
        }
    }

    public static void main(String[] args) {
        Outer outer = new Outer();
        Outer.Inner inner = outer.new Inner();
        inner.print();
    }

}
